import sys, os, arcgisscripting

gp = arcgisscripting.create()

gp.CheckOutExtension("3D")

gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/3D Analyst Tools.tbx")

testtokml_kmz = "C:\\tokml\\testtokml.kmz"
guidao_mxd = "C:\\tokml\\guidao.mxd"
# Process: Map To KML...
def tokml():
    gp.MapToKML_3d(guidao_mxd, "Layers", testtokml_kmz, "10000", "NO_COMPOSITE", "VECTOR_TO_IMAGE", "DEFAULT", "1024", "96")
    return 'successful'
result=tokml()
